var URL = require('url').URL;
module.exports.Request=class {

    constructor({url='',callback = null,headers={},proxy={},method='GET',parameter={}}={}){
        this.url = url;
        this.headers = headers;
        this.proxy = proxy;
        this.method = method;
        this.parameter = parameter;
        this.callback = callback;
        this.cookie=false;
    }

    joinUrl(sliceUrl){
        let u = new URL(this.url);
        this.url = u.protocol+"//"+u.host+sliceUrl;
        return this;
    }
}